package com.pronosticnews.server.domain.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Joueur implements fr.ysa.persistence.Entity {

	private static final long serialVersionUID = -816799208251454152L;

	public static enum VALUE_NAME {
		id, club, dateNaissance, nom, poids, prenom, taille, photo
	}

	// primary key
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private java.lang.Integer id;

	// fields
	@Column(name = "prenom", length = 60, nullable = false)
	private java.lang.String prenom;

	@Column(name = "poids", length = 10, nullable = true)
	private java.lang.Integer poids;

	@Column(name = "taille", length = 10, nullable = true)
	private java.lang.Integer taille;

	@Column(name = "date_naissance", length = 10, nullable = true)
	@Temporal(TemporalType.DATE)
	private java.util.Date dateNaissance;

	@Column(name = "nom", length = 100, nullable = false)
	private java.lang.String nom;

	@ManyToOne(fetch = FetchType.EAGER)
	private Club club;

	private Integer photo;
	
	public Club getClub() {
		return club;
	}

	public void setClub(Club club) {
		this.club = club;
	}

	public java.lang.Integer getId() {
		return id;
	}

	public void setId(java.lang.Integer _id) {
		this.id = _id;
	}

	public java.lang.String getPrenom() {
		return prenom;
	}

	public void setPrenom(java.lang.String prenom) {
		this.prenom = prenom;
	}

	public java.lang.Integer getPoids() {
		return poids;
	}

	public void setPoids(java.lang.Integer poids) {
		this.poids = poids;
	}

	public java.lang.Integer getTaille() {
		return taille;
	}

	public void setTaille(java.lang.Integer taille) {
		this.taille = taille;
	}

	public java.util.Date getDateNaissance() {
		return dateNaissance;
	}

	public void setDateNaissance(java.util.Date _dateNaissance) {
		this.dateNaissance = _dateNaissance;
	}

	public java.lang.String getNom() {
		return nom;
	}

	public void setNom(java.lang.String nom) {
		this.nom = nom;
	}

	@Override
	public List<String> getColumnNameValues() {
		List<String> list = new ArrayList<String>();
		for (VALUE_NAME value : VALUE_NAME.values()) {
			list.add(value.name());
		}
		return list;
	}

	public Integer getPhoto() {
		return photo;
	}

	public void setPhoto(Integer photo) {
		this.photo = photo;
	}
}